﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MicroTest
{
    public partial class StudentView : Form
    {
        public StudentView()
        {
            InitializeComponent();
        }
        private System.Windows.Forms.Control.ControlCollection controls;
        public StudentView(System.Windows.Forms.Control.ControlCollection control)
        {
            controls = control;
            InitializeComponent();
        }

        private void StudentView_Load(object sender, EventArgs e)
        {
           while(controls.Count>0)
            {
                foreach (Control c in controls)
                {
                    var lab = (Label)(c as DrawingWindow).Controls.Find("labPenID", true)[0];
                    studentpanel.Controls.Add(c as DrawingWindow);
                    Label ll = new Label();
                    ll.Text = lab.Text;
                    ll.Visible = true;
                    ll.Height = 15;
                    stulist.Controls.Add(ll);
                    controls.Remove(c);
                }
                
            }
           

        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();            
        }
    }
}
